package com.shop.entity;

public class Order {
    private int id; // 对应数据库表中的id字段
    private int userId; // 对应数据库表中的user_id字段
    private String amount; // 对应数据库表中的amount字段
    private String status; // 对应数据库表中的status字段
    private int merchantId;
    private int productId;// 对应数据库表中的merchant_id字段
    private String productName;



    // 构造器、getter和setter方法
    public Order(int userId, String amount, int merchantId,int productId,String productName) {
        this.userId = userId;
        this.amount = amount;
        this.merchantId = merchantId;
        this.productId=productId;
        this.status = "准备发货中"; // 假设新订单的初始状态为"PENDING"
        this.productName=productName;
    }

    public Order(int userId, String amount, int merchantId,int productId) {
        this.userId = userId;
        this.amount = amount;
        this.merchantId = merchantId;
        this.productId=productId;
        this.status = "准备发货中"; // 假设新订单的初始状态为"PENDING"

    }

    // 带参构造函数
    public Order(int id, int userId, String amount, String status, int merchantId,int productId,String productName) {
        this.id = id;
        this.userId = userId;
        this.amount = amount;
        this.status = status;
        this.merchantId = merchantId;
        this.productId=productId;
        this.productName=productName;
    }

    // id的getter和setter
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    // userId的getter和setter
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    // amount的getter和setter
    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    // status的getter和setter
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    // merchantId的getter和setter
    public int getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(int merchantId) {
        this.merchantId = merchantId;
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int product_id) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    // 重写toString方法，方便打印对象信息
    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", userId=" + userId +
                ", amount='" + amount + '\'' +
                ", status='" + status + '\'' +
                ", merchantId=" + merchantId +
                '}';
    }
}